Skip to content

test(e2e): wait for real oracle rotation in fee_settings inflate helper#23334

Merged
spalladino merged 1 commit into
merge-train/spartanfrom
claudebox/fix-merge-train-spartan-23303
May 16, 2026
Merged

test(e2e): wait for real oracle rotation in fee_settings inflate helper#23334
spalladino merged 1 commit into
merge-train/spartanfrom
claudebox/fix-merge-train-spartan-23303

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

Why

PR #23253 was dequeued from the merge queue when merge-queue-heavy's grind exercise hit a flake in e2e_fees/fee_settings.test.ts (introduced by #23303, the head of merge-train/spartan). Failing sub-test: reproduces the stale fee snapshot race deterministically. CI log: http://ci.aztec-labs.com/cd390ea14cac1093

expect(received).toBeGreaterThan(expected)

Expected: > 1134386110000n
Received:   1067501300000n
  214 |       expect(bumpedMinFees.feePerL2Gas).toBeGreaterThan((lowerMinFees.feePerL2Gas * 11n) / 10n);

bumpedMinFees (1067501300000) was effectively the natural L2 baseline at that moment — no oracle rotation had occurred. The retry inside inflateL2FeesViaL1BaseFee exited as soon as after > before (with before captured at function entry), but the natural L2 fee fluctuates between L1 blocks (EIP-1559 decay swings the L1 base-fee sample), so a sub-percent upward drift satisfied the exit without the oracle deadband (LIFETIME - LAG = 3 L2 slots = 36 s) ever opening. The test ran for only ~15 s before exiting, well short of the deadband.

The caller's bumpedMinFees > lowerMinFees * 1.1 assertion then failed because lowerMinFees was a separate snapshot taken earlier, and natural drift between the two snapshots was below 10 %.

There is also a latent upper-bound issue: even on a successful rotation the original 3x L1 base-fee bump drives the L2 fee to ~2.0–2.5x once EIP-1559 decay on the rotation-tx's block is applied, which would have also failed higherMinFees > bumpedMinFees (where higherMinFees = lowerMinFees * 2n).

What

Three changes in yarn-project/end-to-end/src/e2e_fees/fee_settings.test.ts:

  • inflateL2FeesViaL1BaseFee takes a reference: GasFees parameter and only returns when after.feePerL2Gas >= reference * 13/10. This distinguishes a real oracle rotation (≥1.5x rise) from ambient noise (≤±10%) and forces the loop to wait through the 36 s deadband.
  • Retry budget grows from 60 s to 90 s to comfortably cover the deadband plus a slot or two of margin.
  • Test feat(json-rpc): initial package #2's synthetic higherMinFees grows from lowerMinFees.mul(2) to lowerMinFees.mul(4), giving unambiguous headroom over the realized bumped fee while staying under the 6x default-padding cap so txWithDefaultPadding is still the comparison point.

Test #1's bounds and semantics are unchanged; only the call site is updated to pass stableMinFees as the reference.

Test plan

  • CI merge-queue-heavy (10 parallel grind runs of e2e_fees/fee_settings)
  • The PR-branch ci-full-no-test-cache already passed at the head commit; the flake only surfaces under grind

Analysis: https://gist.github.com/AztecBot/97861b48883eec686f5978a43a2082bb

ClaudeBox log: https://claudebox.work/s/89d3754c8b2b7140?run=1

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels May 16, 2026
@spalladino spalladino marked this pull request as ready for review May 16, 2026 13:26
@spalladino spalladino enabled auto-merge (squash) May 16, 2026 13:27
@spalladino spalladino merged commit b38f967 into merge-train/spartan May 16, 2026
55 of 61 checks passed
@spalladino spalladino deleted the claudebox/fix-merge-train-spartan-23303 branch May 16, 2026 13:27
AztecBot added a commit that referenced this pull request May 16, 2026
Both fail repeatedly on merge-train attempts under proposer pipelining
despite fix attempts (#23303, #23334 for fee_settings; #23336 for
e2e_amm). Skipping in .test_patterns.yml to land the train; to be
triaged and re-enabled (tracking issue assigned to spalladino).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants